import yaml
import yagmail
import logging
# yaml读取文件的方法
def read_yaml(file_math):
    with open(file_math,'r',encoding='utf-8')as e:
        return yaml.safe_load(e)
# 生成日志的方法
def set_log():
    logging.basicConfig(
        filename='log.txt',
        filemode='w+',
        format='%(message)s->%(asctime)s->%(levelno)s->%(filename)s',
        level=logging.DEBUG)
#发送报告的方法
def send_email(file):
    sen=yagmail.SMTP(user='1582186006@qq.com',password='wnlqxmixkuyjbacg',host='smtp.qq.com')
    sen.send(to='1582186006@qq.com',subject='测试报告',contents='请注意查收测试报告',attachments=file)




